package com.gaofans.nrpc.client.route.impl;

import com.gaofans.nrpc.client.route.RouterPredicate;

import java.net.URI;
import java.util.Objects;

/**
 * 负载均衡的路由器判定器
 * @author GaoFans
 */
public class LoadBalanceRouterPredicate implements RouterPredicate {

    public static final String LB_SCHEME = "lb";

    @Override
    public boolean test(URI uri) {
        return Objects.requireNonNull(uri).getScheme().equalsIgnoreCase(LB_SCHEME);
    }
}
